<template>
  <div :style="{'background-color':bgcolor}" @click="layoutclick">
    <slot style="flex: 1"></slot>
  </div>
</template>
<script>
export default {
  name:'ma-div',
  props:{
    day_bg:{
      default:'#ffffff'
    },
    night_bg:{
      default:'rgba(29,29,29,1)'
    }
  },
  data(){
    return {
      bgcolor:'',
    }
  },
  methods: {
            _bgcolor(){
                let t=this.get_theme()
                let res= (t == 'day' ? this.day_bg : this.night_bg)
                return res
            },
            layoutclick(){
              this.$emit('click','')
            },
            onLoad(p){

            }
        },
        created(){
            this.bgcolor=this._bgcolor()
//            if(this.needChangeTheme){
                let notify=weex.requireModule('notify')
                notify.regist('themeChange',(theme)=>{
                    this.bgcolor=this._bgcolor()
                })
//            }
        }
}
</script>